﻿using Newtonsoft.Json;
using System.Xml;
using System.Xml.Serialization;

namespace GenerateProtocol.Models
{
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport", IsNullable = false)]
    public partial class UnifiedExchangeProtocol
    {

        /// <remarks/>
        public HeadType Head;

        /// <remarks/>
        public FullContentDataType ContentInfo;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("ImportAllowResponse", typeof(UnifiedExchangeProtocolImportAllowResponse))]
        [System.Xml.Serialization.XmlElementAttribute("ImportFeedback", typeof(UnifiedExchangeProtocolImportFeedback))]
        [System.Xml.Serialization.XmlElementAttribute("ImportSubmitResponse", typeof(UnifiedExchangeProtocolImportSubmitResponse))]
        [System.Xml.Serialization.XmlElementAttribute("NotifyResopnse", typeof(DataDefineDataType))]
        public object Item;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class HeadType
    {

        /// <remarks/>
        public string TaskGUID;

        /// <remarks/>
        public string TaskName;

        /// <remarks/>
        public string UserToken;

        /// <remarks/>
        public string TaskCurrentGUID;

        /// <remarks/>
        public string SourceSystemID;

        /// <remarks/>
        public string TargetSystemID;

        /// <remarks/>
        public string CallBackUrl;

        /// <remarks/>
        public SourceType SourceInfo;

        /// <remarks/>
        public ProcessInfoType ProcessInfo;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class SourceType
    {

        /// <remarks/>
        public string Version;

        /// <remarks/>
        public string SourceAction;

        /// <remarks/>
        public string SourceIP;

        /// <remarks/>
        public string SourceMachineName;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class DataDefineDataType
    {

        /// <remarks/>
        public string TypeID;

        /// <remarks/>
        public string TypeName;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("AttributeItem", IsNullable = false)]
        public AttributeItemType[] Attributes;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class AttributeItemType
    {
        /// <summary>
        /// 兼容ItemID
        /// </summary>
        public string ItemID;

        private string _itemCode;
        /// <remarks/>
        public string ItemCode
        {
            get
            {
                if (_itemCode == null)
                    return ItemID;
                return _itemCode;
            }
            set
            {
                _itemCode = value;
            }
        }

        /// <remarks/>
        public string ItemName;

        [XmlElement("Value")]
        //[XmlIgnore]
        public string Value;
        //[JsonIgnore]
        //public XmlNode CDataValue
        //{
        //    get { return new XmlDocument().CreateCDataSection(Value); }
        //    set { Value = value?.Value; }
        //}

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("AttributeItem")]
        public AttributeItemType[] AttributeItem;
    }


    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class FileItemSimpleType
    {

        /// <remarks/>
        public string FileGUID;

        /// <remarks/>
        public FileItemSimpleTypeFileName FileName;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class FileItemSimpleTypeFileName
    {

        /// <remarks/>
        public string FullPath;

        /// <remarks/>
        public string AffixInfo;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class RelationEntityInfo
    {

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("DataSetType", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("EntityType", typeof(string))]
        [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
        public string Item;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public ItemChoiceType ItemElementName;

        /// <remarks/>
        public string ContentID;

        /// <remarks/>
        public long Order;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public bool OrderSpecified;

        /// <remarks/>
        public string ShowName;

        /// <remarks/>
        public string RelationType;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport", IncludeInSchema = false)]
    public enum ItemChoiceType
    {

        /// <remarks/>
        DataSetType,

        /// <remarks/>
        EntityType,
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class EntityRelationInfoType
    {

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)]
        public RelationEntityInfo[] ParentEntities;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)]
        public RelationEntityInfo[] SubEntities;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class MetaDataDefineDataType
    {

        /// <remarks/>
        public string TypeID;

        /// <remarks/>
        public string TypeName;

        ///// <remarks/>
        //[System.Xml.Serialization.XmlArrayItemAttribute("AttributeItem", typeof(AttributeItemType), IsNullable = false)]
        //public AttributeItemType[][] Attributes; //工具会生成两个[][],造成反序列化失败  ????
        //public AttributeItemType[] Attributes;

        /// <summary>
        /// 解决MetaData中Attributes是集合数据不能序列化问题
        /// </summary>
        [System.Xml.Serialization.XmlElementAttribute("Attributes")]
        public AttributesType[] Attributes;
    }

    #region 2017-6-22 13:59:20 add hsl VS自带工具将XSD转C#类时没有生成AttributesType类，造成MetaData中Attributes是集合数据不能序列化

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class AttributesType
    {
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("AttributeItem")]
        public AttributeItemType[] AttributeItem;
    }

    #endregion

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class TimeLineInfoType
    {

        /// <remarks/>
        public string FileGUID;

        /// <remarks/>
        public long TrackID;

        /// <remarks/>
        public long FileInpoint;

        /// <remarks/>
        public long FileOutpoint;

        /// <remarks/>
        public long RefInpoint;

        /// <remarks/>
        public long RefOutpoint;

        /// <remarks/>
        public long MediaChannel;

        /// <remarks/>
        public string IsDBE;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class AudioFormatType
    {

        /// <remarks/>
        public long FileFormat;

        /// <remarks/>
        public long MediaType;

        /// <remarks/>
        public long Channels;

        /// <remarks/>
        public long SamplesRate;

        /// <remarks/>
        public long BitsPerSample;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class VideoFormatType
    {

        /// <remarks/>
        public long FileFormat;

        /// <remarks/>
        public long MediaType;

        /// <remarks/>
        public long ImageWidth;

        /// <remarks/>
        public long ImageHeight;

        /// <remarks/>
        public double FrameRate;

        /// <remarks/>
        public long BitsPerPixel;

        /// <remarks/>
        public long PixelFormat;

        /// <remarks/>
        public long Compression;

        /// <remarks/>
        public long DataRate;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public bool DataRateSpecified;

        /// <summary>
        /// 数据码率【新华网出库要求添加】 2019-4-24 17:48:33
        /// </summary>
        public long BitRate;

        /// <remarks/>
        public long ScanMode;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public bool ScanModeSpecified;

        /// <remarks/>
        public long GopSize;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public bool GopSizeSpecified;

        /// <remarks/>
        public long BFrameCount;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public bool BFrameCountSpecified;

        /// <remarks/>
        public long PFrameCount;

        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        [Newtonsoft.Json.JsonIgnoreAttribute()]
        public bool PFrameCountSpecified;

        /// <remarks/>
        public string PixelForma; //UInt64 PixelForma; //???? 2016-5-17 09:55:02 无符号整型
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class EntityFileFormat
    {

        /// <remarks/>
        public VideoFormatType VideoFormat;

        /// <remarks/>
        public AudioFormatType AudioFormat;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class FileItemType
    {
        /// <remarks/>
        public string FileGUID;

        /// <remarks/>
        public FileItemTypeFileName FileName;

        /// <remarks/>
        //public FileItemTypeFileTypeID FileTypeID;
        public string FileTypeID; //2016-5-17 09:44:01  修改为string，方便扩充

        /// <remarks/>
        public FileItemTypeFileState FileState;

        /// <remarks/>
        public long FileLength;

        /// <remarks/>
        public string FileCreateTime;

        /// <remarks/>
        public EntityFileFormat FileFormat;

        /// <remarks/>
        public decimal FileSize;

        /// <remarks/>
        public string VerifyCode;

        /// <summary>
        /// 2017-11-23 16:03:20(CCTV 体育需求)可选 文件组，高质量videogroup 低质量videogroup_proxy 流媒体preview_file_ 关键帧keyframe_ 默认是 videogroup，兼容默认为空情况
        /// </summary>
        public string GroupName;
        /// <summary>
        /// 增加GroupType，以便可以上传附件之类的文件组
        /// </summary>
        public string GroupType;
        /// <summary>
        /// 文件组额外信息
        /// </summary>
        public string ExtraData;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class FileItemTypeFileName
    {
        /// <remarks/>
        public string FullPath;

        /// <remarks/>
        public string AffixInfo;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public enum FileItemTypeFileTypeID
    {

        /// <remarks/>
        FILETYPE_LOWAVI,

        /// <remarks/>
        FILETYPE_HIGHAVI,

        /// <remarks/>
        FILETYPE_LOWWAV,

        /// <remarks/>
        FILETYPE_HIGHWAV,

        /// <remarks/>
        FILETYPE_WMV,

        /// <remarks/>
        FILETYPE_MXF,

        /// <remarks/>
        FILETYPE_HIGHFULL,

        /// <remarks/>
        FILETYPE_LOWFULL,

        /// <remarks/>
        FILETYPE_PICTURE,

        /// <remarks/>
        FILETYPE_DOCUMENT,
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public enum FileItemTypeFileState
    {

        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("0")]
        Item0,

        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("1")]
        Item1,
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class ContentFileType
    {

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("FileItem")]
        public FileItemType[] FileItem;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("Sequences")]
        public ContentFileTypeSequences[] Sequences;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class ContentFileTypeSequences
    {

        /// <remarks/>
        public long QualityType;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("Snippet")]
        public TimeLineInfoType[] Snippet;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class ContentDataType
    {

        /// <remarks/>
        public ContentFileType ContentFile;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("AttributeItem", IsNullable = false)]
        public AttributeItemType[] EntityData;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class FullContentDataType
    {

        /// <remarks/>
        public string ContentID;

        /// <remarks/>
        public string TypeID;

        /// <remarks/>
        public string TypeName;

        /// <remarks/>
        public ContentDataType ContentData;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("MetaData")]
        public MetaDataDefineDataType[] MetaData;

        /// <remarks/>
        public EntityRelationInfoType EntityRelationInfo;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class ProcessInfoType
    {

        /// <remarks/>
        public string ProcessID;

        /// <remarks/>
        public string ProcessName;

        /// <remarks/>
        public string ProcessPRI;

        /// <remarks/>
        public string ProcessDesc;

        /// <remarks/>
        public string ProcessType;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("ExternalParamInfo")]
        public ProcessInfoTypeExternalParamInfo[] ExternalParamInfo;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class ProcessInfoTypeExternalParamInfo
    {

        /// <remarks/>
        public string ParamCode;

        /// <remarks/>
        public string ParamName;

        /// <remarks/>
        public string ParamValue;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class UnifiedExchangeProtocolImportAllowResponse
    {

        /// <remarks/>
        public string Status;

        /// <remarks/>
        public string Description;

        /// <remarks/>
        public string ContentID;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("FileItem")]
        public FileItemSimpleType[] FileItem;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("AttributeItem", IsNullable = false)]
        public AttributeItemType[] Attributes;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class UnifiedExchangeProtocolImportFeedback
    {

        /// <remarks/>
        public string Status;

        /// <remarks/>
        public string Description;

        /// <remarks/>
        public string ContentID;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("AttributeItem", IsNullable = false)]
        public AttributeItemType[] Attributes;
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]

    [System.Diagnostics.DebuggerStepThroughAttribute()]

    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MSBUSPlatform/v2.0/FreeContentImport")]
    public partial class UnifiedExchangeProtocolImportSubmitResponse
    {

        /// <remarks/>
        public string Status;

        /// <remarks/>
        public string Description;

        /// <remarks/>
        public string ContentID;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("AttributeItem", IsNullable = false)]
        public AttributeItemType[] Attributes;
    }
}
